/*
https://leetcode-cn.com/problems/chalkboard-xor-game/solution/hei-ban-yi-huo-you-xi-by-leetcode-soluti-eb0c/
 */
public class Solution810 {
    public boolean xorGame(int[] nums) {
        if (nums.length%2==0){
            return true;
        }else{
            int x=0;
            for (int num : nums) {
                x=x^num;
            }
            return x==0;
        }
    }

    public static void main(String[] args) {
        System.out.println(new Solution810().xorGame(new int[]{1,1,2}));
    }
}
